#### license: creative commons cc0 1.0 (public domain) 
#### http://creativecommons.org/publicdomain/zero/1.0/ 
function vget g k
python
    return g[k]
    fig
    fig

function vset g k v
python
    g[k] = v
    return g
    fig
    fig

function sh buf params
    insp    vget params "insp"
    glen    vget params "g" len
    tlen    ".sh"    len    times -1  plus glen
    cmdline vget params "g"        ltrim  rtrim     right tlen  ltrim
python
    cmdline = cmdline.encode('utf-8')
    fig
    pad arr mid 1 0
    pad vget params "g"  arr
    bg  vget params "g"       rtrim  right 1   instr bg "&"
    ifequal bg 0
        padcmd cmdline arrshell
        pad plus padcmd
        next
    iftrue bg
        now cmdline shell
        next
    iftrue pad
        now vset params "text" buf  vset params "pad" pad
        params now return params
        next
    fig




